<template>
  <div>
    <el-form :inline="true" class="form">
      <el-form-item :label="`${props.searchTitle}：`">
        <el-input :placeholder="`请你输入${props.searchTitle}搜索`" v-model="keyword"></el-input>
      </el-form-item>
      <el-form-item>
        <el-button
          type="primary"
          size="default"
          :disabled="keyword ? false : true"
          v-model="keyword"
          @click="search"
          >搜索</el-button
        >
        <el-button type="primary" size="default" @click="reset">重置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script setup lang="ts">
import { reactive, toRefs, ref, onMounted } from 'vue'
let keyword = ref()
let props = defineProps(['searchTitle'])
let emit = defineEmits(['search'])
//const searchState = defineModel()
const search = () => {
  emit('search', keyword.value)
}

import { useSettingStore } from '@/stores/modules/setting'
import { update } from 'lodash'
const settingStore = useSettingStore()
//重置按钮
const reset = () => {
  settingStore.refresh = !settingStore.refresh
}
</script>
<style scoped lang="scss"></style>
